package com.sleep.satokendemo.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import org.springframework.stereotype.Component;

/**
 * @author GuoAo
 * @className XMLUtil
 * @date 2024/12/1
 * @description TODO
 */
@Component
public class XMLUtil {

    private final ObjectMapper mapper = new XmlMapper();

    public String getXMLString(Object data) throws JsonProcessingException {
        return mapper.writeValueAsString(data);
    }
}
